package dgo.Geometry;

public class Rectangle {
  public int top, left, width, height;
  public Rectangle(int left, int top, int width, int height){
    this.top = top;
    this.left = left;
    this.width = width;
    this.height = height;
  }
  
  public int h_middle(){
    return this.left + this.width / 2;
  }

  public int v_middle(){
    return this.top + this.height / 2;
  }

  public int right(){
    return this.left + this.width;
  }
      
  public int bottom(){
    return this.top + this.height;
  }

  public boolean isIncluded(int x, int y){
    return this.left <= x && x <= this.right() && this.top <= y && y <= this.bottom(); 
  }
}
